﻿<Window x:Class="Tum.PDE.ToolFramework.Modeling.Visualization.VMXExtensions.Html.View.InsertImagePopup"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Height="285"  Width="400" WindowStartupLocation="CenterScreen" WindowStyle="ToolWindow"
        Title="{Binding Path=Title}"
        Icon="/Tum.PDE.ToolFramework.Modeling.Visualization.VMXExtensions;component/Resources/Images/HtmlEditor/insert-image.ico"
        xmlns:attached="clr-namespace:Tum.PDE.ToolFramework.Modeling.Visualization.Controls.Attached;assembly=Tum.PDE.ToolFramework.Modeling.Visualization">
    <GroupBox Header="Image options">
        <Grid Margin="3">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>

            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>

            <TextBlock Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="0" Text="Select an image source (*.png, *.jpeg)"/>
            <TextBox Grid.Column="0" Grid.Row="1" IsEnabled="False" Text="{Binding Path=SourcePath, Mode=OneWay}"/>
            <Button Grid.Column="1" Grid.Row="1" Command="{Binding Path=BrowseCommand}" Padding="0" BorderBrush="Transparent" Background="Transparent" BorderThickness="0">
                <Button.Content>
                    <StackPanel Orientation="Horizontal">
                        <Image Source="/Tum.PDE.ToolFramework.Modeling.Visualization.VMXExtensions;component/Resources/Images/HtmlEditor/image-16x16.png"/>
                        <TextBlock Text="Browse" Margin="3,0,0,0"/>
                    </StackPanel>
                </Button.Content>
            </Button>

            <Grid Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" Margin="3,8,0,0">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" SharedSizeGroup="LeftColumn" />
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>

                <!-- RelativePath -->
                <TextBlock Grid.Column="0" Grid.Row="0" Text="RelativePath"/>
                <TextBox Grid.Column="1" Grid.Row="0" IsEnabled="False" Text="{Binding RelativePath, Mode=OneWay}" Margin="5,0,0,0"/>

                <!-- ImageId -->
                <TextBlock Grid.Column="0" Grid.Row="1" Text="Id" Margin="0,8,0,0"/>
                <TextBox Grid.Column="1" Grid.Row="1" IsEnabled="False" Text="{Binding ImageId, Mode=OneWay}" Margin="5,8,0,0"/>

                <!-- AlternativeText -->
                <TextBlock Grid.Column="0" Grid.Row="2" Text="Alternative text" Margin="0,8,0,0"/>
                <TextBox Grid.Column="1" Grid.Row="2" Text="{Binding AlternativeText, Mode=TwoWay}" Margin="5,8,0,0"/>

                <!-- ExportWidth -->
                <TextBlock Grid.Column="0" Grid.Row="3" Text="Export width" Margin="0,8,0,0"/>
                <TextBox Grid.Column="1" Grid.Row="3" Text="{Binding ExportWidth, Mode=TwoWay}" Margin="5,8,0,0"/>

                <!-- ExportHeight -->
                <TextBlock Grid.Column="0" Grid.Row="4" Text="Export height" Margin="0,8,0,0"/>
                <TextBox Grid.Column="1" Grid.Row="4" Text="{Binding ExportHeight, Mode=TwoWay}" Margin="5,8,0,0"/>
            </Grid>
            <Grid Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2">
                <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,8,0,5">
                    <Button x:Name="ButtonAdd" IsDefault="True"  Content="Ok" Width="70" Margin="0, 0, 3, 0" IsEnabled="{Binding Path=IsInsertionValid}" 
                Command="{Binding CloseActivePopUpCommand}" CommandParameter="True"/>
                    <Button x:Name="ButtonCancel" Content="Cancel" Width="70" IsCancel="True"/>
                </StackPanel>
            </Grid>
        </Grid>
    </GroupBox>
</Window>
